package framework.interfaces;

import framework.world.Direction;

/**
 * Library of methods for the RuleSet plugin to use to determine which state
 * it should switch to
 */
public interface Cell {
	
	/**
	 * Gets the state of the Cell
	 * @return the int representation of the Cell's state
	 */
	public int getState();
	
	/**
	 * A count of how many neighbors are in the specified state. This is
	 * restricted to the number of neighbors specified in the plugin
	 * @param state The state neighbors must be in to count
	 * @return How many neighbors are in state state
	 */
	public int getNeighborCount(int state);
	
	/**
	 * Get the state of a neighbor cell in the specified direction
	 * @param dir The direction to the cell to get the state of
	 * @return The state of the cell in direction dir
	 */
	public int getAdjacentCellState(Direction dir);
	
	/**
	 * Sets the Machine State to the specified value
	 * @param newMachineState The new value of the Machine State
	 */
	public void setMachineState(int newMachineState);
	
	
	/**
	 * Gets the value of the Machine State
	 * @return the value of the Machine State
	 */
	public int getMachineState();
}
